<?php
/**
 * Created by JetBrains PhpStorm.
 * User: Administrator
 * Date: 12-8-11
 * Time: 下午12:41
 * To change this template use File | Settings | File Templates.
 */
class logout extends MY_Controller
{
    public function __construct()
    {
        parent::__construct();

        if (!$this->isLogin()) {
            $this->load->helper('url');
            redirect("/");
            return ;
        }
    }

    public function index()
    {
        $this->load->helper('cookie');
        self::include_uc_lib();
        $redirect_url = '/';
        set_cookie('auth', '', time() - 86400);
        $synlogout = uc_user_synlogout();
        $this->message('注销账户', "成功退出 {$synlogout}" , $redirect_url);
    }
}
